﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Back-end.Master" AutoEventWireup="true" CodeBehind="SuaNguoiDung.aspx.cs" Inherits="TracNghiemTinHocDaiCuong.SuaNguoiDung" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
        <script type="text/javascript">
            $(document).ready(function () {
                $("#txtNgaySinh").datepicker({
                    changeMonth: true,
                    changeYear: true,
                    yearRange: '-100:+0'
                });
                $("#txtNgaySinh").datepicker("option", "dateFormat", "dd/mm/yy");
            }); 
    </script>
    <script type="text/javascript">
        function validateForm() {
            var x = document.getElementById('txtEmail').value;
            var atpos = x.indexOf("@");
            var dotpos = x.lastIndexOf(".");
            if (atpos < 1 || dotpos < atpos + 2 || dotpos + 2 >= x.length) {
                alert("Not a valid e-mail address");
                return false;
            }
        }
    </script>
    <table border="0" cellspacing="2px" cellpadding="4px" width="100%" class="table">
    	<tr>
    		<td>Tên tài khoản</td>
            <td>
                <asp:TextBox ID="txtTenTaiKhoan" runat="Server" CssClass="txt"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>Bạn có muốn đổi mật khẩu?</td>
            <td>
                <asp:CheckBox ID="chkMatKhau" runat="server" Text="" AutoPostBack="true"
                OnCheckedChanged="chkMatKhau_CheckedChanged"/>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblMatKhau" runat="server" Visible="false">Mật khẩu</asp:Label>
            </td>
            <td>
                
                <asp:TextBox Visible="false" ID="txtMatKhau" runat="Server" CssClass="txt" TextMode="Password"></asp:TextBox>
                <br />
                <asp:RegularExpressionValidator ID="revMatKhau" runat="server" ForeColor="Red"
                ControlToValidate="txtMatKhau" ErrorMessage="Mật khẩu phải có ít nhất 6 kí tự"
                ValidationExpression=".{6,}"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblNhacLaiMatKhau" runat="server" Visible="false">Nhắc lại mật khẩu</asp:Label>
            </td>
            <td>
                <asp:TextBox Visible="false" ID="txtNhacLaiMatKhau" runat="server" CssClass="txt" TextMode="Password"></asp:TextBox>
                <br />
                <asp:CompareValidator ID="cvMatKhau" runat="server" ControlToValidate="txtNhacLaiMatKhau"
                ControlToCompare="txtMatKhau" ErrorMessage="Mật khẩu không khớp" ForeColor="Red"></asp:CompareValidator>
            </td>
        </tr>
        <tr>
            <td>Họ và tên</td>
            <td>
                <asp:TextBox ID="txtHoTen" runat="Server" CssClass="txt"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>Ngày sinh</td>
            <td>
                <asp:TextBox ID="txtNgaySinh" runat="Server" CssClass="txt" ClientIDMode="Static"></asp:TextBox>
            </td>
    	</tr>
        <tr>
            <td>Email</td>
            <td>
                <asp:TextBox ID="txtEmail" runat="Server" CssClass="txt"></asp:TextBox>
                <br />
                <asp:RegularExpressionValidator ID="revEmail" runat="server" ControlToValidate="txtEmail"
                ForeColor="Red" ErrorMessage="Email không đúng"
                    ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
            </td>
    	</tr>
        <tr>
            <td>Giới tính</td>
            <td>
                <asp:RadioButtonList ID="rblGioiTinh" runat="Server" RepeatDirection="Horizontal">
                    <asp:ListItem>Nam</asp:ListItem>
                    <asp:ListItem style="margin-left:100px">Nữ</asp:ListItem>
                </asp:RadioButtonList>
            </td>
    	</tr>
        <tr>
            <td>Điện thoại</td>
            <td>
                <asp:TextBox ID="txtDienThoai" runat="Server" CssClass="txt"></asp:TextBox>
                <br />
                <asp:RegularExpressionValidator ID="revDienThoai" runat="server"
                ControlToValidate="txtDienThoai" ForeColor="Red" ErrorMessage="Số điện thoại không đúng"
                    ValidationExpression="\d{9,11}"></asp:RegularExpressionValidator>
            </td>
    	</tr>
        <tr>
            <td>Địa chỉ</td>
            <td>
                <asp:TextBox ID="txtDiaChi" runat="Server" CssClass="txt"></asp:TextBox>
            </td>
    	</tr>
        <tr>
            <td>Ngày đăng kí</td>
            <td>
                <asp:TextBox ID="txtNgayDangKi" runat="Server" CssClass="txt" 
                ReadOnly="true" BackColor="#E5E5E5"></asp:TextBox>
            </td>
    	</tr>
        <tr>
            <td>Là quản trị</td>
            <td>
                <asp:CheckBox ID="chkLaQuanTri" runat="server"/>
            </td>
    	</tr>
        <tr>
            <td colspan="2">
                <asp:Label ID="lblThongBao" runat="server" CssClass="lblThongBao"></asp:Label>
            </td>
        </tr>
        <tr>
            <td></td>
            <td>
                <asp:Button ID="btnSuaNguoiDung" runat="Server" Text="Sửa"
                OnClick="btnSuaNguoiDung_Click" CssClass="btn"/>&nbsp&nbsp
                <asp:Button ID="btnQuayLai" runat="Server" Text="Quay lại"
                OnClick="btnQuayLai_Click" CssClass="btn" CausesValidation="false"/>
            </td>
        </tr>
    </table>
</asp:Content>
